home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / wpj1_8.zip / FDIAG.ZIP / MAINFRM.CPP < prev    next >
C/C++ Source or Header  |  1993-08-12  |  2KB  |  110 lines

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "fdiag.h"
  6.  
  7. #include "mainfrm.h"
  8.  
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char BASED_CODE THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CMainFrame
  16.  
  17. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  18.  
  19. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  20.     //{{AFX_MSG_MAP(CMainFrame)
  21.         // NOTE - the ClassWizard will add and remove mapping macros here.
  22.         //    DO NOT EDIT what you see in these blocks of generated code !
  23.     ON_WM_CREATE()
  24.     //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // arrays of IDs used to initialize control bars
  29.  
  30. // toolbar buttons - IDs are command buttons
  31. static UINT BASED_CODE buttons[] =
  32. {
  33.     // same order as in the bitmap 'toolbar.bmp'
  34.     ID_FILE_NEW,
  35.     ID_FILE_OPEN,
  36.     ID_FILE_SAVE,
  37.         ID_SEPARATOR,
  38.     ID_EDIT_CUT,
  39.     ID_EDIT_COPY,
  40.     ID_EDIT_PASTE,
  41.         ID_SEPARATOR,
  42.     ID_FILE_PRINT,
  43.     ID_APP_ABOUT,
  44. };
  45.  
  46. static UINT BASED_CODE indicators[] =
  47. {
  48.     ID_SEPARATOR,            // status line indicator
  49.     ID_INDICATOR_CAPS,
  50.     ID_INDICATOR_NUM,
  51.     ID_INDICATOR_SCRL,
  52. };
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CMainFrame construction/destruction
  56.  
  57. CMainFrame::CMainFrame()
  58. {
  59.     // TODO: add member initialization code here
  60. }
  61.  
  62. CMainFrame::~CMainFrame()
  63. {
  64. }
  65.  
  66. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  67. {
  68.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  69.         return -1;
  70.  
  71.     if (!m_wndToolBar.Create(this) ||
  72.         !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
  73.         !m_wndToolBar.SetButtons(buttons,
  74.           sizeof(buttons)/sizeof(UINT)))
  75.     {
  76.         TRACE("Failed to create toolbar\n");
  77.         return -1;        // fail to create
  78.     }
  79.  
  80.     if (!m_wndStatusBar.Create(this) ||
  81.         !m_wndStatusBar.SetIndicators(indicators,
  82.           sizeof(indicators)/sizeof(UINT)))
  83.     {
  84.         TRACE("Failed to create status bar\n");
  85.         return -1;        // fail to create
  86.     }
  87.  
  88.     return 0;
  89. }
  90.  
  91.  
  92. /////////////////////////////////////////////////////////////////////////////
  93. // CMainFrame diagnostics
  94.  
  95. #ifdef _DEBUG
  96. void CMainFrame::AssertValid() const
  97. {
  98.     CFrameWnd::AssertValid();
  99. }
  100.  
  101. void CMainFrame::Dump(CDumpContext& dc) const
  102. {
  103.     CFrameWnd::Dump(dc);
  104. }
  105.  
  106. #endif //_DEBUG
  107.  
  108. /////////////////////////////////////////////////////////////////////////////
  109. // CMainFrame message handlers
  110.